package msgs;
import java.io.*;

/**
 * Basic client message object. Used for inheritance and for initial login
 * Team 9: Andrew Hayworth, Brian Parrella, Ryan Kortmann, Nina Papa
 * @author Andrew Hayworth
 *
 */

public class ClientMsg implements TTConstants, Serializable {
	private Actions action;
	private Responses response;
	private String ip, name, pwd;
	private byte[] clientKey;
	private String user;
	private boolean logIt;
	private String msg;
	private String[] chats;
	
	public ClientMsg () {}
	public ClientMsg(String ip, String name, String pwd) {
		this.ip = ip;
		this.name = name;
		this.pwd = pwd;
	}
	public ClientMsg(String ip, String name, String pwd, byte[] key) {
		this(ip, name, pwd);
		this.clientKey = key;
	}
	public ClientMsg(ConnectedUser c, Actions a) {
		this(c.getIp(), c.getName(), c.getPwd(), c.getClientKey());
		this.action = a;
	}
	public ClientMsg(ConnectedUser c, Actions a, String user, boolean logIt) {
		this(c.getIp(), c.getName(), c.getPwd(), c.getClientKey());
		this.action = a;
		this.user = user;
		this.logIt = logIt;
	}
	public ClientMsg(String ip, String name, String pwd, byte[] key, String user, String msg) {
		this(ip, name, pwd);
		this.clientKey = key;
		this.user = user;
		this.msg = msg;
	}
	public ClientMsg(String ip, String name, String pwd, byte[] key, String[] chats) {
		this(ip, name, pwd);
		this.clientKey = key;
		this.chats = chats;
	}
	
	public TTConstants.Actions getAction() { return action; }
	public void setAction(TTConstants.Actions action) {
		this.action = action;
	}
	
	public Responses getResponse() { return response; }
	public void setResponse(TTConstants.Responses response) {
		this.response = response;
	}
	
	public String getIP() { return ip; }
	public void setIP(String ip) { this.ip = ip; }
	
	public String getName() { return name; }
	public void setName(String n) { name = n; }
	
	public String getPwd() { return pwd; }
	public void setPwd(String p) { pwd = p; }
	
	public byte[] getClientKey() { return clientKey; }
	public void setClientKey(byte[] k) { clientKey = k; }
	
	public String getIp() {
		return ip;
	}
	public void setIp(String ip) {
		this.ip = ip;
	}
	public String getUser() {
		return user;
	}
	public void setUser(String user) {
		this.user = user;
	}
	public boolean isLogIt() {
		return logIt;
	}
	public void setLogIt(boolean logIt) {
		this.logIt = logIt;
	}
	public String getMsg() {
		return msg;
	}
	public void setMsg(String msg) {
		this.msg = msg;
	}
	public String[] getChats() {
		return chats;
	}
	public void setChats(String[] chats) {
		this.chats = chats;
	}
	
	
}
